﻿@namespace Masa.Blazor
@inherits BDomComponentBase

<div class="@CssProvider.GetClass()"
     style="@CssProvider.GetStyle()"
     id="@Id"
     @ref="Ref">
    <CascadingValue Value="this" IsFixed>
        @ChildContent
    </CascadingValue>

    @for (var i = 0; i < _panes.Count; i++)
    {
        var index = i;
        var pane = _panes[index];

        <div class="@CssProvider.GetClass("pane", pane)"
             style="@CssProvider.GetStyle("pane", pane)">
            @pane.ChildContent
        </div>

        @if (index != _panes.Count - 1)
        {
            <div class="@CssProvider.GetClass("bar")"
                 style="@CssProvider.GetStyle("bar")"
                 @key="@index"
                 @onmousedown="@(_ => HandleMousedown(index))"
                 @ontouchstart=@(_ => HandleMousedown(index))>
                @BarContent
            </div>
        }
    }
</div>
